package com.qh.yyxt.controller;

import com.qh.yyxt.pojo.ThingDTO;
import com.qh.yyxt.service.ThingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ThingController
{
    @Autowired
    private ThingService thingService;
    //物品展示 图片名字
    @RequestMapping("/user/getThings")
    @ResponseBody
    public List<ThingDTO> getThings()
    {
       return thingService.findAllToApply();
    }
    //展示两类物品的借用表 0-普通 1-招聘会
    @RequestMapping("/user/getThingsByType")
    @ResponseBody
    public List<ThingDTO> getThings(Integer flag)
    {
        if(flag==null)
            return null;
        return thingService.findAllToApply(flag);
    }
}

